/**
 * Created by CaoShi at 2021/2/10 21:39.
 */

#include <iostream>
#include <string>
#include <utility>

using namespace std;

#ifndef VIRTUALFUNCTION_DEMO_ABSTRACTMAKEDRINK_H
#define VIRTUALFUNCTION_DEMO_ABSTRACTMAKEDRINK_H
/**
 *  定义抽象类, 制作饮料
 */
class AbstractMakeDrink {

    // 1. 烧水
    virtual void BoilWatter() = 0;
    // 2. 加入原料
    virtual void AddMaterial() = 0;
    // 3. 加入辅料
    virtual void AddOthers() = 0;
    // 4. 加水冲泡
    virtual void AddWatter() = 0;

private:
    string drunkName;

public:

    /**
     *  流程
     */
    void MakeDrink() {
        this->BoilWatter();
        this->AddMaterial();
        this->AddOthers();
        this->AddWatter();
        cout << this->getDrunkName() << " 制作完毕..." << endl;
    }

    void setDrunkName(string name) {
        this->drunkName = std::move(name);
    }

    string  getDrunkName() {
        return this->drunkName;
    }

};


#endif //VIRTUALFUNCTION_DEMO_ABSTRACTMAKEDRINK_H
